<?php
/*
Created On: 26th, 2005.
Description: This file is used to logout User .
*/

//****************Include files******************
session_start();
include_once("../codelibrary/inc/variables.php");//Using variables.php for Database Connectivity
include_once("../codelibrary/inc/functions.php");//Using functions.php for using getAnyTableWhereData()

// will be Changed in case server is in a different location
/*$datetime= indianDate(); 
$datetimenew = explode(" ", $datetime);
$date= $datetimenew[0];
$time =$datetimenew[1];*/

$datetime = date("Y-m-d H:i:s");
$datetimenew = explode(" ", $datetime);
$date= $datetimenew[0];
$time =$datetimenew[1];

$t=$time;
//editData($users_login_trail_table,$LogoutTime,$t);
$query="update $users_login_trail_table set LogoutTime='$t' where TrailID='$sess_Trail_ID'";
mysql_query($query);
session_unset();
session_destroy();
header("location: login.php?logerr=logout");
exit;
?>